<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>泰思曼积分排行</title>
<style type="text/css">

</style></head>

<body>
<?php
include_once("base-class.php");

//新建sae数据库类
$mysql = new SaeMysql();

//获取当前页码
$page=intval($_GET["page"]);

//获取操作标识传入
//$action=$_GET["action"];
//$action= string::un_script_code($action);
//$action= string::un_html($action);


//获取员工ID号传入

//列表数据获取、分页

//计算总数
$count=$mysql->getVar("select COUNT(*) from roster where 1 ");
//如果数据表里有数据
if($count)
{
    //每页显示记录数
    $page_num = 50;
    //如果无页码参数则为第一页
    if ($page == 0) $page = 1;
    //计算开始的记录序号
    $from_record = ($page - 1) * $page_num;
    //获取符合条件的数据
    // $list_list=$mysql->getData("select *
    //          from list where $list_name =  $rostar_name
    //          limit $from_record,$page_num");
    
    

    $list_top10=$mysql->getData("SELECT list_name,sum(list_money),roster_id FROM `list`,`roster` where list_name=roster_name and roster_status=1 and list_money>0 and list_status=1 group by list_name ORDER BY sum(list_money)  DESC ");
    
    //分页函数
    $multi = multi($count, $page_num, $page, "list_all.php");
}
?>
<div class="container">
  <div class="content">
    <h1 align="center">泰思曼积分排行</h1>
    <p align="center">      
    <div align="center">
      <table width="329" border=1>
        <tr>
          <td width="42"><div align="left">名次</div></td><td width="78"><div align="center">姓名</div></td><td width="91"><div align="center">总分</div></td><td width="98"><div align="center">操作</div></td>
          </tr>
        <?php
			if($list_top10)
            {
                
                $number=1;
                foreach($list_top10 as $value)
                {
                    $TotalScore=$mysql->getVar("SELECT sum(list_money) FROM `list` where list_name= '$value[list_name]' and list_money>0  and list_status=1 ");
                    echo "<tr>
                          <td>$number</td>
                          <td>$value[list_name]</td>
                          <td>$TotalScore</td>
                          <td><a href=\"http://teslamoney.vipsinaapp.com/list_list.php?id=".$value["roster_id"]."\">查看明细</a></td>
                          <tr>";
                    $number++;
                }
            }
			else
            {
                echo "<tr><td colspan=7>无记录</td></tr>";
            }
        ?>
        
        </table>
    </div>
    </p>
    <!-- end .content --></div>
  <!-- end .container --></div>
</body>
</html>